'''
 爬虫类的应用
'''
from Apr10.templates.pcUtils import *
import time


s =pcScrawler()
url='http://tj.sina.com.cn/'
#body > div:nth-child(4) > div.slideTxtBox.fl > ul > li:nth-child(1) > div.imgBox > a > img
#body > div:nth-child(4) > div.slideTxtBox.fl > ul > li:nth-child(2)  div.imgBox > a > img
picUrl = s.getImgUrl(url,selector='div.news-img > a > img')
for index,url in enumerate(picUrl):
    s.getImg(url,imgName ="TP-"+str(index)+".jpg")
    print("大哥")
    time.sleep(1)